/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.wpi.first.wpilibj.templates.commands;

import edu.wpi.first.wpilibj.templates.subsystems.FrontRoller;
import edu.wpi.first.wpilibj.Victor;

/**
 *
 * @author Erin
 */
public class RollerCommand extends CommandBase {
    
    private static final float MOTOR_SPEED__FORWARD = 1f;
    private static final float MOTOR_SPEED__REVERSE = -1f;
    public static Victor rollerMotor = new Victor(6);
    
    private float currentSpeed;
    
    public RollerCommand() {
        super("RollerCommand");
        requires(frontRoller);
        currentSpeed = 0;
    }
   

    // Called just before this Command runs the first time
    protected void initialize() {
        if(currentSpeed == 0)
            currentSpeed = MOTOR_SPEED__FORWARD;
        else if(currentSpeed == MOTOR_SPEED__FORWARD)
            currentSpeed = MOTOR_SPEED__REVERSE;
        else if(currentSpeed == MOTOR_SPEED__REVERSE)
            currentSpeed = MOTOR_SPEED__FORWARD;
        rollerMotor.set(currentSpeed);
    }

    // Called repeatedly when this Command is scheduled to run
    protected void execute() {
    }

    // Make this return true when this Command no longer needs to run execute()
    protected boolean isFinished() {
        return false;
    }

    // Called once after isFinished returns true
    protected void end() {
    }

    // Called when another command which requires one or more of the same
    // subsystems is scheduled to run
    protected void interrupted() {
    }
}
